// C.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;

class A
{
protected:
	int x;
public:
	virtual void HelloWorld()
	{
		cout<<"This is base class";
	}
};

class B : public virtual A
{
public:
	void HelloWorld()
	{
		cout<<"Hello world";
	}
};

class C : public virtual A
{
public:
	void HelloWorld()
	{
		cout<<"Hello world";
	}
};

class D : public B, public C
{
public:
	void HelloWorld()
	{
		cout<<"Hello world";
	}

	void GetA()
	{
		cout<<this->x;
	}
};


void Test(A *a)
{
	a->HelloWorld();
}

int _tmain(int argc, _TCHAR* argv[])
{

}
